package cn.deepxi.org.service.impl;



import cn.deepxi.org.domain.Employee;
import cn.deepxi.org.mapper.EmployeeMapper;
import cn.deepxi.org.query.DeptQuery;
import cn.deepxi.org.query.EmpQuery;
import cn.deepxi.org.service.IEmpService;
import cn.deepxi.utils.QueryResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
* @Description: TODO
* @Author: Mr.Pu
* @Version: 1.0
* @Date:  2022/4/19 18:52
*/
@Service
public class EmpServiceImpl implements IEmpService {
    @Autowired
    private EmployeeMapper employeeMapper;
    @Override
    public void add(Employee department) {
        employeeMapper.add(department);
    }

    @Override
    public void del(Long id) {
        employeeMapper.del(id);
    }

    @Override
    public void upt(Employee emlpoyee) {
        employeeMapper.upt(emlpoyee);
    }

    @Override
    public Employee findById(Long id) {
        return employeeMapper.findById(id);
    }

    @Override
    public List<Employee> findAll() {
        return employeeMapper.findAll();
    }

    
    @Override
    public QueryResult<Employee> queryData(EmpQuery query) {
        Long count = employeeMapper.queryCount(query);
        List<Employee> data = employeeMapper.queryData(query);
        return new QueryResult<Employee>(count,data);
    }

    @Override
    public void batchDel(List<Long> ids) {
      employeeMapper.patchDel(ids);
    }
}
